const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/login',
    name: 'Login',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "login" */ '@/views/login.vue')
  },
  {
    path: '/Home',
    redirect: '/welcome',
    name: 'home',
    meta: { title: '后台首页' },
    component: () => import(/* webpackChunkName: "home" */ '@/views/Home/home.vue'),
    children: [
      {
        path: '/welcome',
        name: 'welcome',
        meta: { title: '后台首页' },
        component: () => import(/* webpackChunkName: "welcome" */ '@/views/Home/welcome.vue')
      },
      // 用户管理
      {
        path: '/user',
        name: 'user',
        meta: { title: '用户管理' },
        component: () => import(/* webpackChunkName: "user" */ '@/views/Home/user/list.vue'),
        children: [
          {
            path: '/userList',
            name: 'userList',
            meta: { title: '用户列表' },
            component: () => import(/* webpackChunkName: "userlist" */ '@/views/Home/user/list.vue')
          }
        ]
      },
      // 站点管理
      {
        path: '/info',
        name: 'info',
        meta: { title: '站点管理' },
        component: () => import(/* webpackChunkName: "infoContent" */ '@/views/Home/infomation/infoContent.vue'),
        children: [
          {
            path: '/infoContent',
            name: 'infoContent',
            meta: { title: '站点介绍' },
            component: () => import(/* webpackChunkName: "infoContent" */ '@/views/Home/infomation/infoContent.vue')
          }
        ]
      },
      // 文章管理
      {
        path: '/blog',
        name: 'blog',
        redirect: '/blogList',
        meta: { title: '文章管理' },
        component: () => import(/* webpackChunkName: "blog" */ '@/views/Home/blog/index.vue'),
        children: [
          {
            path: '/blogAddCate',
            name: 'blogAddCate',
            meta: { title: '文章分类' },
            component: () => import(/* webpackChunkName: "blogaddCate" */ '@/views/Home/blog/addCate.vue')
          },
          {
            path: '/blogAdd',
            name: 'blogAdd',
            meta: { title: '添加文章' },
            component: () => import(/* webpackChunkName: "blogaddBlog" */ '@/views/Home/blog/addBlog.vue')
          },
          {
            path: '/blogEdit/:id',
            name: 'blogEdit',
            meta: { title: '编辑文章' },
            component: () => import(/* webpackChunkName: "blogeditBlog" */ '@/views/Home/blog/editBlog.vue')
          },
          {
            path: '/blogView/:id',
            name: 'blogView',
            meta: { title: `文章预览-{$id}` },
            component: () => import(/* webpackChunkName: "blogview" */ '@/views/Home/blog/view.vue')
          },
          {
            path: '/blogList',
            name: 'blogList',
            meta: { title: '文章列表' },
            component: () => import(/* webpackChunkName: "bloglist" */ '@/views/Home/blog/list.vue')
          }
        ]
      }
    ]
  },
  // {path: '*', redirect: '/404'}
  {
    path: '*',
    name: '404',
    meta: { title: '404' },
    component: () => import(/* webpackChunkName: "404" */ '../views/404.vue')
  },
]

export default routes